home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Information / Digests / CSMP Digest / volume 1 / csmp-v1-162.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  54.5 KB  |  998 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Sat, 08 Aug 92       Volume 1 : Issue 162
  2.  
  3. Today's Topics:
  4.  
  5.     Location of selected printer?
  6.     Religious Question: How Do The Metaphors Fit Together?
  7.     Is System 7 written in C++?
  8.  
  9.  
  10.  
  11. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  12.  
  13. The digest is a collection of article threads from the internet newsgroup
  14. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  15. regularly and want an archive of the discussions.  If you don't know what a
  16. newsgroup is, you probably don't have access to it.  Ask your systems
  17. administrator(s) for details.  (This means you can't post questions to the
  18. digest.)
  19.  
  20. Each issue of the digest contains one or more sets of articles (called
  21. threads), with each set corresponding to a 'discussion' of a particular
  22. subject.  The articles are not edited; all articles included in this digest
  23. are in their original posted form (as received by our news server at
  24. cs.uoregon.edu).  Article threads are not added to the digest until the last
  25. article added to the thread is at least one month old (this is to ensure that
  26. the thread is dead before adding it to the digest).  Article threads that
  27. consist of only one message are generally not included in the digest.
  28.  
  29. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  30. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  31. file /pub/mac/csmp-digest/README before downloading any files.  The most
  32. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  33. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  34. archive has a mail server; send a message with the text '$MACarch help' (no
  35. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  36.  
  37. The digest is also available via email.  Just send a note saying that you
  38. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  39. automatically receive each new issue as it is created.  Sorry, back issues
  40. are not available through the mailing list.
  41.  
  42. Send administrative mail to mkelly@cs.uoregon.edu.
  43.  
  44.  
  45. -------------------------------------------------------
  46.  
  47. From: cinquin@imag.fr ( Philippe Cinquin)
  48. Subject: Location of selected printer?
  49. Date: 3 Jul 92 17:30:42 GMT
  50. Organization: IMAG Institute, University of Grenoble, France
  51.  
  52. Just a simple question (I hope!): where is the name of the printer choosen
  53. by the user through the chooser stored? How can I get it and change it?
  54. (I know I normally shouldn't change it, but this is a special case).
  55.  
  56. If you email please do so at " ocinquin@timb.imag.fr ". Thanks in advance.
  57.  
  58. +++++++++++++++++++++++++++
  59.  
  60. From: zobkiw@world.std.com (Joe Zobkiw)
  61. Date: 4 Jul 92 16:07:47 GMT
  62. Organization: The World Public Access UNIX, Brookline, MA
  63.  
  64. The name of the printer is stored in the printer driver. The name of the
  65. printer driver is stored in the system file. There are some gotchas if you
  66. try to change these, so don't! That's what the Chooser is for.
  67.  
  68.  
  69. - -- 
  70. - -- joe zobkiw                      Internet: zobkiw@world.std.com
  71. - --                                      AOL: AFL Zobkiw  
  72. - -- mac.synthesis.MIDI.THINK C.OOP
  73. - -- asm.comm.networks.cool tunes...
  74.  
  75. ---------------------------
  76.  
  77. From: orpheus@reed.edu (P. Hawthorne)
  78. Subject: Religious Question: How Do The Metaphors Fit Together?
  79. Date: 6 Jul 92 01:03:41 GMT
  80. Organization: Reed College, Portland OR
  81.  
  82. I am afraid I am a casualty of object orientation. In trying to put the
  83. parts of the standard user interface together in a consistent framework,
  84. I have become confused about how they ought to fit together.  I feel like
  85. Winnie the Pooh looking for the North Pole, blind to the metal rod right
  86. under his very nose... :-)
  87.  
  88. The notion of a selection dominates the edit commands, even more so than
  89. the clipboard. If there is no current selection, the cut, copy and clear
  90. commands are dim. If there is no chance of having a selection in a given
  91. situation or the selection does not accept the contents of the clipboard,
  92. the paste command is dim. So, it appears that the clipboard is a servant of
  93. the selection. Fine, great, so...
  94.  
  95. The selection itself appears to be an aspect of the window. The window
  96. draws and erases the selection when it is activated or deactivated.
  97. However, when one has more than one window open showing part of the same
  98. document, the windows are actually sharing the same selection. So the
  99. selection can be an aspect of the window that is actually a reference to
  100. an aspect of the document.
  101.  
  102. As if that were way too easy, some windows use one of many forms of
  103. selection which might not have anything to do with the document per se.
  104. Windows such as dialogs that edit a part of the document often have their
  105. own notion of selection such as: the blinking insertion caret in an edit
  106. text dialog item; or a window in which one can have selected either
  107. icons, part of the name of an icon, or arcs between icons.
  108.  
  109. So at any time there is one current application, one current window that
  110. implies one current document, and one current selection. Does this sound
  111. right or am I missing something? Does anyone else wonder about all this?
  112. Could it be that I have become completely obsessed?
  113.  
  114.  Theus (orpheus@reed.edu)
  115. (If you consider this a waste of bandwidth, I beg your pardon.)
  116.  
  117. +++++++++++++++++++++++++++
  118.  
  119. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  120. Date: 6 Jul 92 06:38:40 GMT
  121. Organization: University of Waikato, Hamilton, New Zealand
  122.  
  123. In article <1992Jul6.010341.9143@reed.edu>, orpheus@reed.edu (P. Hawthorne)
  124. writes:
  125.  
  126. [sorry for rearranging the bits of your posting, but it seemed easier
  127. to respond to them in this order...]
  128.  
  129. > So at any time there is one current application, one current window that
  130. > implies one current document, and one current selection.
  131.  
  132. Yup, this is how it's supposed to be. It's certainly what the AppleEvent
  133. Object Model expects.
  134.  
  135. > As if that were way too easy, some windows use one of many forms of
  136. > selection which might not have anything to do with the document per se.
  137. > Windows such as dialogs that edit a part of the document often have their
  138. > own notion of selection such as: the blinking insertion caret in an edit
  139. > text dialog item; or a window in which one can have selected either
  140. > icons, part of the name of an icon, or arcs between icons.
  141.  
  142. Well, the selection has to do with whatever is being manipulated in the
  143. window. The window might be a dialog for examining and changing settings
  144. to do with a document. Consider the standard PutFile dialog in System 7;
  145. the current selection can either be an item in a list, or some part of
  146. an editable text field. The only reason you can't select both sorts of
  147. things at once is simply because it doesn't make sense, given the way
  148. the dialog is supposed to work.
  149.  
  150. > The selection itself appears to be an aspect of the window. The window
  151. > draws and erases the selection when it is activated or deactivated.
  152. > However, when one has more than one window open showing part of the same
  153. > document, the windows are actually sharing the same selection. So the
  154. > selection can be an aspect of the window that is actually a reference to
  155. > an aspect of the document.
  156.  
  157. In my experience, the handling of multiple views of the same document
  158. tends to vary somewhat. In spite of all the bad things that M#%$#S@ft have
  159. done, Excel *can* serve as a useful model in this one respect: it lets
  160. you split a window into panes, so that you can do useful things like
  161. manipulate all four corners of a large rectangular selection without lots
  162. of scrolling.
  163.  
  164. The MPW Shell (3.2 and later) has a similar, if more elaborate, scheme.
  165. It only shows you the selection in one window pane at a time, but otherwise
  166. the selection behaves similarly to Excel--you can click at one point in
  167. one pane, and then shift-click at a different point being shown in another
  168. pane, to select everything between those two points in the document.
  169.  
  170. For those applications that let you open multiple separate windows
  171. showing the same document, the selection in each window is usually independent.
  172. Thus, it might be considered to be a property of the window, not of the
  173. document. But then the question arises of which selection you save with the
  174. document.
  175.  
  176. I just checked this in Claris Resolve, and it's got a solution I wasn't
  177. aware of before. I opened a new worksheet, selected cell C17, typed something
  178. into it, and then saved and closed the worksheet. Then I reopened it, asked
  179. for a "New View" (which creates a new window showing the same document),
  180. selected cell C6 in the new window, and typed something else in, leaving
  181. C6 selected. Next I went back to the first window, where cell C17 was still
  182. selected, and saved my changes with that window in front. And guess what--it
  183. saved the fact that I had two views open! When I reopened the document, I got
  184. two windows, the first with cell C17 selected, the second with cell C6 selected.
  185.  
  186. So there's an interesting solution for you. I still wish Resolve had
  187. Excel-style panes (and no, "Titles" are *not* a satisfactory substitute), but
  188. it's obvious the user-interface folks at Claris haven't been *completely*
  189. asleep. :-)
  190.  
  191. > Could it be that I have become completely obsessed?
  192.  
  193. All the good Mac hackers are. :-)
  194.  
  195. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  196. Computer Services Dept                     fax: +64-7-838-4066
  197. University of Waikato            electric mail: ldo@waikato.ac.nz
  198. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  199. Ask not for whom the phone rings; it rings for you.
  200.  
  201. ---------------------------
  202.  
  203. From: ian@syacus.acus.oz.au (Ian Joyner)
  204. Subject: Is System 7 written in C++?
  205. Organization: ACUS Australian Centre for Unisys Software, Sydney
  206. Date: Thu, 28 May 1992 01:34:08 GMT
  207.  
  208. Kent,
  209.  
  210. Here is a question for you or anyone else who cares to clarify this point.
  211. You may have read in comp.lang.c++ that Andrew Koenig claimed that
  212. system 7 was rewritten in C++, from object Pascal. To my knowledge
  213. previous systems were written in 68000 assembler, not OP. I believe
  214. Finder has been rewritten in C++ (can't remember where I got this from,
  215. maybe this newsgroup), but has the whole of system 7 been written
  216. in C++?
  217.  
  218. Thanks for the clarification :-)
  219.  
  220. - -- 
  221. Ian Joyner                                     ACSNet: ian@syacus.acus.oz
  222. ACUS (Australian Centre for Unisys Software)   Internet: ian@syacus.acus.oz.au
  223. 115-117 Wicks Rd, North Ryde, N.S.W, Australia 2113.
  224. Tel 61-2-390 1328      Fax 61-2-390 1391       UUCP: ...uunet!munnari!syacus.oz
  225.  
  226. +++++++++++++++++++++++++++
  227.  
  228. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  229. Date: 28 May 92 18:05:30 GMT
  230. Organization: Peirce Software
  231.  
  232.  
  233. In article <1992May28.013408.27837@syacus.acus.oz.au> (comp.sys.mac.programmer), ian@syacus.acus.oz.au (Ian Joyner) writes:
  234. > Kent,
  235. > Here is a question for you or anyone else who cares to clarify this point.
  236. > You may have read in comp.lang.c++ that Andrew Koenig claimed that
  237. > system 7 was rewritten in C++, from object Pascal. To my knowledge
  238. > previous systems were written in 68000 assembler, not OP. I believe
  239. > Finder has been rewritten in C++ (can't remember where I got this from,
  240. > maybe this newsgroup), but has the whole of system 7 been written
  241. > in C++?
  242.  
  243. I think it's difficult to say that any particular language was used
  244. to write the Mac system.  Parts are writtren in a variety of languages.
  245. 680X0 asm is a good chunk, Pascal and C code are in there in some
  246. places.  C++ was used to write most of the new Finder.
  247.  
  248. What does it really matter?
  249.  
  250. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  251. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  252. - --  Makers of...        --   San Jose, California USA 95117
  253. - --                      --   voice: (408) 244-6554 fax: (408) 244-6882
  254. - --     SMOOTHIE         --   AppleLink: peirce & America Online: AFC Peirce
  255.  
  256. +++++++++++++++++++++++++++
  257.  
  258. From: casseres@apple.com (David Casseres)
  259. Date: 28 May 92 16:50:39 GMT
  260. Organization: Apple Computer, Inc.
  261.  
  262. In article <1992May28.013408.27837@syacus.acus.oz.au>, ian@syacus.acus.oz.au
  263. (Ian Joyner) writes:
  264.  
  265. > Here is a question for you or anyone else who cares to clarify this point.
  266. > You may have read in comp.lang.c++ that Andrew Koenig claimed that
  267. > system 7 was rewritten in C++, from object Pascal. To my knowledge
  268. > previous systems were written in 68000 assembler, not OP. I believe
  269. > Finder has been rewritten in C++ (can't remember where I got this from,
  270. > maybe this newsgroup), but has the whole of system 7 been written
  271. > in C++?
  272.  
  273. Parts of System 7, notably the Finder, were rewritten in C++.  Parts are in C,
  274. and some parts may still be Pascal.  I don't believe any of it was ever Object
  275. Pascal, but previous systems were written in a mixture of assembly and Pascal.
  276.  
  277. (I guess if you want to be very technical about it, Mac Pascal *is* s arguments, I'm inclined to
  278. . agree with him. I forget what issue it was, but I know that he wrote or is
  279. . writing some sort of BASIC compiler for HyperCard or something.
  280.  
  281.   Somehow it seems that a BASIC compiler for HyperCard sounds like frozen
  282. molasses moving uphill during a Utah Winter. First impressions, I guess...
  283.  
  284.   Unless there is a lot of time or experience devoted to making the lowest
  285. levels of a framework as tight as possible, any layered project is going to
  286. be slow. Sometimes it seems that you can have only ever have a robust
  287. project, an efficient project, or a lackluster tradeoff between the two.
  288.  
  289.   Imho, anything extending HyperCard functionality is going to have to be
  290. just blatantly and convincingly fast or it could be dismissed as a dog.
  291. Interesting point, though. Understable for this guy to make it, given the
  292. project you say he's working on.
  293.  
  294.  
  295.   Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  296. . Speed of the application is dependent upon the "smartness" of the
  297. . compiler and the skill of the programmer not the language used.  You
  298. . can't make general claims like that about languages.
  299.  
  300.   Granted. However, there must be some plausible explanation for why so
  301. many C programmers so often claim that C is inherently faster than Pascal,
  302. or why so many C programmers cite the bad points of ancient Pascal dialects
  303. as proof of the superiority of C.
  304.  
  305.   One of the things I hear most often is that C is more "low level" than
  306. Pascal, and therefore obviously going to be faster. Dubious, ain't it?
  307.  
  308.   Imho, the idea that a lower level of abstraction brings with it speed
  309. flies in the face of algorithms and problem solving.
  310.  
  311.   For instance, I find that the "with" statement in Pascal helps me to
  312. write and read much more expressive code for the perfect data structure in
  313. the appropriate algorithm than, say, register variables in C helps me to.
  314.  
  315.   While I yearn for a macro facility and an assembler within Pascal, I owe
  316. a great deal of the efficiency of the projects I can write in a finite
  317. amount of time to the "with" statement. I'm not trying to start a flamewar
  318. here, just pointing out something I find significant.
  319.  
  320.  
  321.   Matt Mora then goes on to say:
  322. . Think Pascal has been proven to beat Think C in a few examples in producing
  323. . faster code. This was in the past before Think C had an optimizer. Things
  324. . have probably changed since then.
  325.  
  326.   The two do seem to be equivalent in speed of compiled code. Of course,
  327. the best compiler optimization pales against a more appropriate algorithm.
  328. Then again, Pascal does seem to be going the way of Pick and News... A lot
  329. more people write C compilers than Pascal compilers in school... I dare say
  330. that real soon now, comparing C and Pascal will be like comparing fractals
  331. and Newtonian forward differencing. (What's that? That's the point.)
  332.  
  333.   I dunno for sure, but I think that both of those products could be
  334. optimized further. I have written anything that does a better job, so my
  335. opinion isn't really worth anything at all. I suspect, however, register
  336. allocation could be improved with peephole optimization tempered by special
  337. cases for the register-based traps.
  338.  
  339.   My kingdom for a new and improved object method dispatching technique!
  340. Does Objective C on the NeXT do something the two Think products don't?
  341.  
  342.   Theus (orpheus@reed.edu) 
  343.  
  344. +++++++++++++++++++++++++++
  345.  
  346. From: mxmora@unix.SRI.COM (Matt Mora)
  347. Date: 5 Jun 92 18:35:08 GMT
  348. Organization: SRI International, Menlo Park, California
  349.  
  350. In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  351.  
  352. >  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  353. >. Speed of the application is dependent upon the "smartness" of the
  354. >. compiler and the skill of the programmer not the language used.  You
  355. >. can't make general claims like that about languages.
  356.  
  357. >  Granted. However, there must be some plausible explanation for why so
  358. >many C programmers so often claim that C is inherently faster than Pascal,
  359. >or why so many C programmers cite the bad points of ancient Pascal dialects
  360. >as proof of the superiority of C.
  361.  
  362. Is this the same C that now has strict prototype checking, check pointer
  363. types and all the nasty type checking that Pascal has? Hmmm sounds
  364. like the same "bad points of ancient Pascal dialects as proof of the 
  365. superiority of C" is now being infiltrated into C. :-)
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373. Matt
  374.  
  375. - -- 
  376. ___________________________________________________________
  377. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  378. SRI International           |  my unix  mxmora@unix.sri.com
  379. ___________________________________________________________
  380.  
  381. +++++++++++++++++++++++++++
  382.  
  383. From: buckeye@spf.trw.com (John Wallace)
  384. Organization: TRW Data Systems Center, Redondo Beach, CA
  385. Date: Sat, 6 Jun 92 01:58:15 GMT
  386.  
  387. In article <35705@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  388. >In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  389. >
  390. >>  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  391. >>. Speed of the application is dependent upon the "smartness" of the
  392. >>. compiler and the skill of the programmer not the language used.  You
  393. >>. can't make general claims like that about languages.
  394. >
  395. >>  Granted. However, there must be some plausible explanation for why so
  396. >>many C programmers so often claim that C is inherently faster than Pascal,
  397. >>or why so many C programmers cite the bad points of ancient Pascal dialects
  398. >>as proof of the superiority of C.
  399. >
  400. >Is this the same C that now has strict prototype checking, check pointer
  401. >types and all the nasty type checking that Pascal has? Hmmm sounds
  402. >like the same "bad points of ancient Pascal dialects as proof of the 
  403. >superiority of C" is now being infiltrated into C. :-)
  404. >
  405.  
  406. Choice of language usually boils down to a matter of preference and
  407. which is best supported on a system.  When I program Suns, I use C.
  408. When I program NeXTs I use Objective C.  When I program Macs, I use
  409. Pascal.  In each case I use the language that makes the fewest waves
  410. on that platform.
  411.  
  412. As to "which is faster: C or Pascal", I'll agree with Matt: it depends
  413. on the compiler.  There is nothing inherintly faster in C. Most
  414. compiler writers acknowledge that it is much easier to make a low-end C 
  415. compiler than a Pascal compiler.  BUT, as soon as you're talking about 
  416. an optimizing compiler, it is MUCH easier to produce a highly optimizing 
  417. Pascal compiler because of the idealized for loop, strong type checking, 
  418. and rarity of pointers.  Looking at the state of things today on the Mac, 
  419. the performance of Pascal and C is within a couple of percent either
  420. way, depending on the application.  If you want a big performance 
  421. increase (100% to 500%), use assembler.
  422.  
  423. As far as saying: 
  424. >>  ... there must be some plausible explanation for why so
  425. >>many C programmers so often claim that C is inherently faster than Pascal,
  426. >>or why so many C programmers cite the bad points of ancient Pascal dialects
  427. >>as proof of the superiority of C.
  428.  
  429. It just sounds like _software racism_ to me :-)
  430.  
  431. Cheers!
  432. John
  433. - ----
  434. John Wallace    buckeye@spf.trw.com
  435.  
  436.  
  437. +++++++++++++++++++++++++++
  438.  
  439. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  440. Date: 6 Jun 92 00:16:24 GMT
  441. Organization: Peirce Software
  442.  
  443.  
  444. In article <35705@unix.SRI.COM> (comp.sys.mac.programmer), mxmora@unix.SRI.COM (Matt Mora) writes:
  445. > In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  446. > >  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  447. > >. Speed of the application is dependent upon the "smartness" of the
  448. > >. compiler and the skill of the programmer not the language used.  You
  449. > >. can't make general claims like that about languages.
  450. > >  Granted. However, there must be some plausible explanation for why so
  451. > >many C programmers so often claim that C is inherently faster than Pascal,
  452. > >or why so many C programmers cite the bad points of ancient Pascal dialects
  453. > >as proof of the superiority of C.
  454. > Is this the same C that now has strict prototype checking, check pointer
  455. > types and all the nasty type checking that Pascal has? Hmmm sounds
  456. > like the same "bad points of ancient Pascal dialects as proof of the 
  457. > superiority of C" is now being infiltrated into C. :-)
  458.  
  459. I've always though it humorous that C continues to load up with features
  460. from the languages that hard core C people used to hate.  Your comments
  461. about strict type checking above are one example.  C++ goes even further
  462. in this direction adding a number of great features from Ada (operator
  463. overloading, exception handling, and generics for instance - C++ even
  464. uses the bazarre word pragma just like Ada :-) ).
  465.  
  466. Not that I'm complaining.  C (& C++) has gotten almost useable over
  467. the years - thank goodness since its harder and harder to resist using it.
  468.  
  469. P.S.  If only Ada had been invented a few years later and gotten real
  470. OOPs included we'd have a decient language for MacApp!  
  471.  
  472. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  473. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  474. - --  Makers of...        --   San Jose, California USA 95117
  475. - --                      --   voice: (408) 244-6554 fax: (408) 244-6882
  476. - --     SMOOTHIE         --   AppleLink: peirce & America Online: AFC Peirce
  477.  
  478. +++++++++++++++++++++++++++
  479.  
  480. From: orpheus@reed.edu (P. Hawthorne)
  481. Date: 6 Jun 92 07:07:53 GMT
  482. Organization: Reed College, Portland, Oregon
  483.  
  484.  
  485.   Prometheus Hawthorne, orpheus@reed.edu, writes:
  486. . However, there must be some plausible explanation for why....  so many C
  487. . programmers cite the bad points of ancient Pascal dialects as proof of the
  488. . superiority of C.
  489.  
  490.   Matt Mora, mxmora@unix.SRI.COM, writes:
  491. . Is this the same C that now has strict prototype checking, check pointer
  492. . types and all the nasty type checking that Pascal has?
  493.  
  494.   Michael Pierce, peirce@outpost.SF-Bay.org, writes:
  495. . I've always though it humorous that C continues to load up with features
  496. . from the languages that hard core C people used to hate.... 
  497.  
  498.   Yeah. It may seem hypocritical on hindsight, but Pascal could do with
  499. some of that vibrancy. C does seem to be very much a living language, being
  500. extended and redefined. My father has always given me an odd perspective on
  501. things about computers. He was a computer nerd, just like his dad was, and
  502. there's a certain historical context that pokes up every now and then.
  503.  
  504.   For instance, some time ago, my dad asked me if I was using Algol now. I
  505. just din't have the heart to tell him that it was Object Pascal, since this
  506. was just after he found out how cheap megabytes of memory are for me now.
  507. He was still a little sore. He's still lecturing me about the time he spent
  508. weaving magnetic core memory and saying that if I can't do something in 4K,
  509. I should just give up now. Noble... Ancient but noble.
  510.  
  511.   Then I started to notice things from my really old Encyclopedia of
  512. Computer Science. (It was a childhood altar for me.) I had no idea at the
  513. time, but Pascal is pretty much Algol 68 with a bunch more data types. The
  514. object extensions are about all that has really changed with the language
  515. since then, it begins to seem.
  516.  
  517.  
  518.   Michael Pierce, peirce@outpost.SF-Bay.org, elaborates:
  519. . C++ goes even further in this direction adding a number of great features
  520. . from Ada (operator overloading, exception handling, and generics for
  521. . instance - C++ even uses the bazarre word pragma just like Ada :-) ).
  522. . P.S. If only Ada had been invented a few years later and gotten real
  523. . OOPs included we'd have a decent language for MacApp!  
  524.  
  525.   Ada compilers sure are priced for government contractor's budgets! It 
  526. reads nicely, and I've liked what I've seen, but the user base sure is a
  527. lot more bloated... er, sure are a lot more affluent than I am!
  528.   Speaking of Ada, I would like to think that Pascal could incorporate the
  529. actor-based systems paradigm and regain a bit of the luster it has lost
  530. over the years, but the momentum does seem to be on the side of C.
  531.   Besides, how could anyone ever convince Borland to incorporate actor
  532. extensions into Turbo Pascal?
  533.  
  534.   Theus
  535.   orpheus@reed.edu
  536.  
  537. +++++++++++++++++++++++++++
  538.  
  539. From: Bruce.Hoult@bbs.actrix.gen.nz
  540. Date: Sun, 7 Jun 1992 15:34:32 GMT
  541. Organization: Actrix Information Exchange
  542.  
  543. In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  544. >   My kingdom for a new and improved object method dispatching technique!
  545. > Does Objective C on the NeXT do something the two Think products don't?
  546.  
  547.  
  548. Have you looked at C++?
  549.  
  550. The method dispatch code possible with C++ (especially the non-multiple-
  551. inheritance style found in CFront 1.2 and "SingleObject" descendents in
  552. Apples version) is about as efficient as it's possible to get.
  553.  
  554. - -- 
  555. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  556. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  557. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  558. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  559.  
  560. +++++++++++++++++++++++++++
  561.  
  562. From: newbery@rata.vuw.ac.nz (Michael Newbery)
  563. Date: Sun, 7 Jun 1992 21:57:15 GMT
  564. Organization: Computing Serv. Ctr, Victoria Uni., Wellington, New Zealand
  565.  
  566. In article <1992Jun6.070753.16192@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  567. >  Then I started to notice things from my really old Encyclopedia of
  568. >Computer Science. (It was a childhood altar for me.) I had no idea at the
  569. >time, but Pascal is pretty much Algol 68 with a bunch more data types. The
  570. >object extensions are about all that has really changed with the language
  571. >since then, it begins to seem.
  572.  
  573. Pardon? I assume/hope you mean Algol 60.
  574.  
  575. Algol68 has lots of stuff lacking in Pascal, including rather more data
  576. types, operator overloading, etc. etc.
  577.  
  578. - --
  579. Michael.Newbery@vuw.ac.nz
  580. There is no national science just as there is no national multiplication table;
  581.  
  582. +++++++++++++++++++++++++++
  583.  
  584. From: ksand@apple.com (Kent Sandvik)
  585. Date: 8 Jun 92 03:01:46 GMT
  586. Organization: MacDTS Mongols
  587.  
  588. In article <1992Jun7.153432.20292@actrix.gen.nz>, Bruce.Hoult@bbs.actrix.gen.nz
  589. writes:
  590. > In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne)
  591. writes:
  592. > >   My kingdom for a new and improved object method dispatching technique!
  593. > > Does Objective C on the NeXT do something the two Think products don't?
  594. > Have you looked at C++?
  595.  
  596. > The method dispatch code possible with C++ (especially the non-multiple-
  597. > inheritance style found in CFront 1.2 and "SingleObject" descendents in
  598. > Apples version) is about as efficient as it's possible to get.
  599.  
  600.    And no dynamic runtime method dispatching, something that Objective-C has.
  601. Sigh. I guess the runtime binding standardization efforts will produce
  602. this feature, 1994 or so.
  603. - --
  604.                                               Cheers, Kent
  605.  
  606.  
  607. +++++++++++++++++++++++++++
  608.  
  609. From: urlichs@smurf.sub.org (Matthias Urlichs)
  610. Date: 23 Jun 1992 13:20:50 +0200
  611. Organization: University of Karlsruhe, FRG
  612.  
  613. In comp.sys.mac.programmer, article <1992Jun3.141558.12607@wam.umd.edu>,
  614.   nebel@wam.umd.edu (Chris D. Nebel) writes:
  615. < In article <35602@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  616. < >A few months back, someone in Dr. Dobb's was interviewed and went on about
  617. < >the myth that C is faster than Pascal.
  618. <This reminds me of an article I saw a couple of years back: it was a commentary
  619. <by Dave Small about the trials and travails he had writing writing the Spectre,
  620. <a (sort of) Mac emulator for the Atari ST.  He went on for a while about how
  621. <the entire Mac system bit the big one because it was all based around that
  622. <horrible, godawful language Pascal, instead of a nice, efficient, sensible one
  623. <like C (which the ST OS was written in (I think.)) [this is irony, folks! No
  624. <flames!]  His main two gripes were that (1) Pascal was hideously slow and (2)
  625. <that any program written in Pascal was automatically really huge, because using
  626. <just one routine from a library would put the entire library in your program
  627. <(giving such fun things as a 200K "hello world" program).
  628. < The funny thing is that both of these gripes are absolutely true -- of UCSD
  629. < Pascal for the Apple II, the official Apple-distributed Pascal for the Apple
  630. < II at the time.  Nothing like first impressions, eh?
  631.  
  632. The observation about linking is also true for at least one of the early
  633. Pascal compilers for the Mac, and probably also for at least one Pascal on
  634. the Atari. ;-) Incidentally, it's also true for about every development
  635. system on about every existing UNIX machine. Yes, this includes C.
  636.  
  637. BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  638. conventions on the 68000. The trap dispatcher is a beast which probably would
  639. be implemented quite differently today, also...
  640.  
  641. - -- 
  642. "I've been called an evil genius by cities of assholes...  but I know who
  643.  these people are!  And they're on my list!" 
  644.  -- Robert Crumb
  645. - -- 
  646. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  647. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  648.  
  649. +++++++++++++++++++++++++++
  650.  
  651. From: Bruce.Hoult@bbs.actrix.gen.nz
  652. Date: 24 Jun 92 09:32:51 GMT
  653. Organization: Actrix Information Exchange
  654.  
  655. In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  656. > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  657. > conventions on the 68000. The trap dispatcher is a beast which probably would
  658. > be implemented quite differently today, also...
  659.  
  660. Interesting.
  661.  
  662. Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  663. (and before that Datalight) compilers) says that one of the big wins
  664. in compiling C code using a C++ compiler is that C++ is able to use
  665. "Pascal" calling conventions for speed.
  666.  
  667. This is because C compilers have to be prepared to accept any number
  668. of parameters, wheras C++ (unless you use ...) and Pascal functions
  669. have a fixed numnber of parameters.
  670. - -- 
  671. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  672. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  673. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  674. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  675.  
  676. +++++++++++++++++++++++++++
  677.  
  678. From: ksand@apple.com (Kent Sandvik (High Priest of SSSM))
  679. Date: 29 Jun 92 02:07:16 GMT
  680. Organization: Secret Society of Software Mungers
  681.  
  682. In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias
  683. Urlichs) writes:
  684. > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  685. > conventions on the 68000. The trap dispatcher is a beast which probably would
  686. > be implemented quite differently today, also...
  687.  
  688. So, does anyone know the story why Windows uses pascal calling conventions in
  689. their
  690. API, performance reasons?
  691.  
  692. Cheers,
  693. Kent
  694.  
  695. +++++++++++++++++++++++++++
  696.  
  697. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  698. Organization: Symantec Corp.
  699. Date: Mon, 29 Jun 1992 14:10:33 GMT
  700.  
  701. In article <27517@goofy.Apple.COM> ksand@apple.com (Kent Sandvik (High Priest of SSSM)) writes:
  702.    In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias Urlichs) writes:
  703.    > BTW, he's got one point -- Pascal calling conventions are a bit
  704.    > slower than C conventions on the 68000. The trap dispatcher is a
  705.    > beast which probably would be implemented quite differently
  706.    > today, also...
  707.  
  708.    So, does anyone know the story why Windows uses pascal calling
  709.    conventions in their API, performance reasons?
  710.  
  711. Code size. Since the bulk of glue code is pushing args on the stack
  712. and popping them off, and since Pascal conventions require that the
  713. callee pops off the arguments, using Pascal calling conventions places
  714. half of that code inside the Mac ROMs (or Windows DLLs). If your code
  715. contains more than one call to any single library routine, then you've
  716. saved a couple bytes of code.
  717.  
  718. Many DOS compilers provide an option that changes all of your C
  719. routines to use Pascal calling conventions for just this reason
  720. (except for those explicitly declared as cdecl, so you can still call
  721. stdio routines). You can of course do this explicitly by using the
  722. pascal keyword before each function, or by using extern "Pascal" in
  723. C++.
  724.  
  725. Some C compilers have an optimization that reduces the code size
  726. difference by waiting until the end of a block/function to remove the
  727. arguments from the stack; in THINK C this is called "defer and combine
  728. stack adjusts".
  729.  
  730.     -phil
  731. - --
  732.    Phil Shapiro                                   Software Engineer
  733.    Language Products Group                     Symantec Corporation
  734.            Internet: phils@cs.brandeis.edu
  735.  
  736. +++++++++++++++++++++++++++
  737.  
  738. From: cory@enigami.mv.com (Cory Kempf)
  739. Date: 30 Jun 92 23:29:46 GMT
  740. Organization: EnigamI, Inc., Nashua, NH
  741.  
  742.  
  743. In article <27517@goofy.Apple.COM> (comp.sys.mac.programmer), ksand@apple.com (Kent Sandvik (High Priest of SSSM)) writes:
  744. >In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias
  745. >Urlichs) writes:
  746. >> BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  747. >> conventions on the 68000. The trap dispatcher is a beast which probably would
  748. >> be implemented quite differently today, also...
  749. >
  750. >So, does anyone know the story why Windows uses pascal calling conventions in
  751. >their
  752. >API, performance reasons?
  753.  
  754. You mean is wasn't just because that is what Apple used?????
  755.  
  756. Grin.
  757.  
  758. +C
  759.  
  760.  
  761. - -------------------------------------------------------------
  762. Cory Kempf                    EnigamI, Inc.
  763. cory@enigami.mv.com           ...!decvax!enigami!cory
  764. Annon:    wi.5036@wizvax.methuen.ma.us
  765. "Reporter : Mr Gandhi, what do you think of Western Civilization ?
  766. Gandhi : I think it would be a good idea."
  767.  
  768. +++++++++++++++++++++++++++
  769.  
  770. From: urlichs@smurf.sub.org (Matthias Urlichs)
  771. Date: 4 Jul 92 04:51:23 GMT
  772. Organization: University of Karlsruhe, FRG
  773.  
  774. In comp.sys.mac.programmer, article <1992Jun24.093251.3225@actrix.gen.nz>,
  775.   Bruce.Hoult@bbs.actrix.gen.nz writes:
  776. < In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  777. < > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  778. < > conventions on the 68000. The trap dispatcher is a beast which probably would
  779. < > be implemented quite differently today, also...
  780. < Interesting.
  781. < Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  782. < (and before that Datalight) compilers) says that one of the big wins
  783. < in compiling C code using a C++ compiler is that C++ is able to use
  784. < "Pascal" calling conventions for speed.
  785. < This is because C compilers have to be prepared to accept any number
  786. < of parameters, wheras C++ (unless you use ...) and Pascal functions
  787. < have a fixed numnber of parameters.
  788.  
  789. I don't know zilch about 80x86 calling conventions.  ;-)
  790.  
  791. On the Mac, however, C and Pascal conventions pass arguments on the stack
  792. (except for the return value in C). Specifically:
  793.  
  794.         C                Pascal
  795.  
  796.                     (Reserve space for return value
  797.                             on stack)
  798.     Push args, right to left    Push args, left to right
  799.     Call function            Call function
  800.         [ Function ]            [ Function ]
  801.         (Move return value into D0)        (Move return value onto stack)
  802.                         Pop return address into register
  803.                         Pop arguments off stack
  804.         Return via RTS            Return via register
  805.     Pop arguments off stack        (Get result off stack)
  806.  
  807. Stuff in parentheses only applies to functions.
  808.  
  809. Obviously, C is cheaper. The C conventions have the added benefit that
  810. you can let the arguments accumulate on the stack and then pop them all
  811. at once.
  812. Having a variable number of arguments is not interesting in the C case
  813. because the first arg always is at the top of the stack; thus the compiler
  814. doesn't have to do anything special for varargs, nor does "procedure" code
  815. differ from "function" code.
  816.  
  817. Interestingly, no Mac language uses register-based calling conventions.
  818. Register-based calling is, in itself, obviously faster than either of the
  819. above schemes because you don't need to access the stack. However, if you
  820. push multiple arguments you effectively steal registers from the compiler so
  821. that setting up the procedure call may get more expensive. Plus, the
  822. procedure then may have to move yet-unused parameters off to the stack
  823. in order to do its job. Whether this tends to increase or decrease running
  824. time is anybody's guess.
  825.  
  826. - -- 
  827. "A raccoon tangled with a 23,000 volt line today.  The results blacked
  828. out 1400 homes and, of course, one raccoon."
  829.         -- Steel City News
  830. - -- 
  831. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  832. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  833.  
  834. +++++++++++++++++++++++++++
  835.  
  836. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  837. Date: 6 Jul 92 03:37:42 GMT
  838. Organization: University of Waikato, Hamilton, New Zealand
  839.  
  840. In article <132smbINN5te@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias Urlichs) writes:
  841. > In comp.sys.mac.programmer, article <1992Jun24.093251.3225@actrix.gen.nz>,
  842. >   Bruce.Hoult@bbs.actrix.gen.nz writes:
  843. > < In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  844. > < > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  845. > < > conventions on the 68000. The trap dispatcher is a beast which probably would
  846. > < > be implemented quite differently today, also...
  847. > <
  848. > < Interesting.
  849. > <
  850. > < Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  851. > < (and before that Datalight) compilers) says that one of the big wins
  852. > < in compiling C code using a C++ compiler is that C++ is able to use
  853. > < "Pascal" calling conventions for speed.
  854. > <
  855. > < This is because C compilers have to be prepared to accept any number
  856. > < of parameters, wheras C++ (unless you use ...) and Pascal functions
  857. > < have a fixed numnber of parameters.
  858. >
  859. > I don't know zilch about 80x86 calling conventions.  ;-)
  860. >
  861. > On the Mac, however, C and Pascal conventions pass arguments on the stack
  862. > (except for the return value in C). Specifically:
  863. >
  864. >         C                Pascal
  865. >
  866. >                     (Reserve space for return value
  867. >                             on stack)
  868. >     Push args, right to left    Push args, left to right
  869. >     Call function            Call function
  870. >         [ Function ]            [ Function ]
  871. >         (Move return value into D0)        (Move return value onto stack)
  872. >                         Pop return address into register
  873. >                         Pop arguments off stack
  874. >         Return via RTS            Return via register
  875. >     Pop arguments off stack        (Get result off stack)
  876. >
  877. > Stuff in parentheses only applies to functions.
  878. >
  879. > Obviously, C is cheaper.
  880.  
  881. Yeah, until you get into things like function results bigger than will
  882. fit into a register. Also, the Pascal convention is quicker for short
  883. routines, particularly those written in assembler. This is because you
  884. can pop each argument off the stack as you use it, eg:
  885.  
  886. ULMUL    proc    export
  887. ;+
  888. ; Function ULMul
  889. ;   (
  890. ;     A, B : LongInt
  891. ;   ) : LongInt
  892. ; returns unsigned long-integer product of A and B.
  893. ;-
  894.     move.l    (sp)+, a0    ; return address
  895.     move.l    (sp)+, d1    ; value of B
  896.     move.l    (sp)+, d0    ; value of A
  897. ... main part of routine omitted ...
  898.     move.l    d2, (sp)    ; return result
  899.     jmp    (a0)        ; all done
  900.     endproc ; ULMUL
  901.  
  902.  
  903. > Interestingly, no Mac language uses register-based calling conventions.
  904.  
  905. I think Consulair Mac C used to. And the current version of MPW C of course
  906. supports it. I guess this convention works best for leaf routines--those which
  907. don't in their turn call other routines. Otherwise you still have to stack
  908. those values when making the inner routine call, which gives you your stack
  909. overhead back again.
  910.  
  911. A similar thing applies to the decision as to whether the called routine
  912. or the caller has to save registers used internally by the called routine.
  913. The Metrowerks Modula-2 compiler by default makes the caller responsible for
  914. the saving, which is contrary to the usual Mac system convention. Again, I'd
  915. say this works best for leaf routines, and doesn't gain you anything in other
  916. situations (except headaches when I forget to call SAVEREGS in a routine being
  917. called by some system code :-)).
  918.  
  919. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  920. Computer Services Dept                     fax: +64-7-838-4066
  921. University of Waikato            electric mail: ldo@waikato.ac.nz
  922. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  923. To someone with a hammer and a screwdriver, every problem looks
  924. like a nail with threads.
  925.  
  926. +++++++++++++++++++++++++++
  927.  
  928. From: Quinn <quinn@cs.uwa.edu.au>
  929. Organization: The University of Western Australia
  930. Date: Tue, 7 Jul 1992 02:08:12 GMT
  931.  
  932.  
  933.  
  934. In article <132smbINN5te@smurf.smurf.sub.org> Matthias Urlichs,
  935. urlichs@smurf.sub.org writes:
  936. >On the Mac, however, C and Pascal conventions pass arguments on the stack
  937. >(except for the return value in C). Specifically:
  938. >
  939. >        C                Pascal
  940. >
  941. >                    (Reserve space for return value
  942. >                            on stack)
  943. >    Push args, right to left    Push args, left to right
  944. >    Call function            Call function
  945. >        [ Function ]            [ Function ]
  946. >        (Move return value into D0)        (Move return value onto stack)
  947. >                        Pop return address into register
  948. >                        Pop arguments off stack
  949. >        Return via RTS            Return via register
  950. >    Pop arguments off stack        (Get result off stack)
  951. >
  952. >Obviously, C is cheaper.
  953.  ^^^^^^^^^^^^^^^^^^^^^^^
  954. Hmmm, "cheaper" may be obvious to you.  And I'd certainly agree with
  955. "faster"
  956. and more "flexible" but "smaller" I'm not so sure.  C has every function
  957. *caller* removing arguments, Pascal has every *function/procedure*
  958. removing
  959. arguments. Now a function must be called at least as many times as it's
  960. declared (Yay for smart linking!) thus is seems that Pascal could be
  961. making
  962. smaller code.
  963.  
  964. Not that this is significant in the global scale of things.  Like the hit
  965. Pascal takes because the 68000 doesn't have an RTD instruction.  I'm just
  966. here to suggest that "all sweeping generalisations are wrong".
  967.  
  968. However C returning function results in D0 is a Big Win (tm).  But life
  969. is easy when you only have to worry about returning longs and smaller
  970. from functions.  Perhaps it would have been smarter for Pascal to
  971. use a register for small things and the stack for large.
  972.  
  973. Regardless it would seem IMHO that register based calling conventions are
  974. the way to go anyway.  [That's most probably because I like putting lots
  975. of small subroutines in my program rather than few big one.  Hell, I think
  976. it makes them easier to read (-: ]  But all these things were graven in
  977. stone
  978. a very long time ago.
  979.  
  980. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  981. Department of Computer Science, The University of Western Australia
  982.   -- Quinn says "Don't put tabs in your postings to Mac groups!"
  983.  
  984. ---------------------------
  985.  
  986. End of C.S.M.P. Digest
  987. **********************
  988.